import request from '@/utils/request'

// 查询宣传信息列表
export function listPoster(query) {
  return request({
    url: '/business/poster/list',
    method: 'get',
    params: query
  })
}

// 查询宣传信息详细
export function getPoster(id) {
  return request({
    url: '/business/poster/' + id,
    method: 'get'
  })
}

// 新增宣传信息
export function addPoster(data) {
  return request({
    url: '/business/poster',
    method: 'post',
    data: data
  })
}

// 修改宣传信息
export function updatePoster(data) {
  return request({
    url: '/business/poster',
    method: 'put',
    data: data
  })
}

// 宣传信息状态修改
export function changePosterStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/business/poster/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除宣传信息
export function delPoster(id) {
  return request({
    url: '/business/poster/' + id,
    method: 'delete'
  })
}
